.class public Lcom/adview/adapters/CaseeAdapter;
.super Lcom/adview/adapters/AdViewAdapter;
.source "CaseeAdapter.java"

# interfaces
.implements Lcn/casee/adsdk/CaseeAdView$AdListener;


# direct methods
.method public constructor <init>(Lcom/adview/AdViewLayout;Lcom/adview/obj/Ration;)V
    .locals 0
    .parameter "adViewLayout"
    .parameter "ration"

    .prologue
    .line 20
    invoke-direct {p0, p1, p2}, Lcom/adview/adapters/AdViewAdapter;-><init>(Lcom/adview/AdViewLayout;Lcom/adview/obj/Ration;)V

    .line 22
    return-void
.end method


# virtual methods
.method public handle()V
    .locals 10

    .prologue
    const/4 v7, 0x0

    .line 27
    invoke-static {}, Lcom/adview/AdViewTargeting;->getRunMode()Lcom/adview/AdViewTargeting$RunMode;

    move-result-object v1

    sget-object v2, Lcom/adview/AdViewTargeting$RunMode;->TEST:Lcom/adview/AdViewTargeting$RunMode;

    if-ne v1, v2, :cond_0

    .line 28
    const-string v1, "AdView SDK v1.7.0"

    const-string v2, "Into CASEE"

    invoke-static {v1, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 29
    :cond_0
    iget-object v1, p0, Lcom/adview/adapters/CaseeAdapter;->adViewLayoutReference:Ljava/lang/ref/WeakReference;

    invoke-virtual {v1}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v8

    check-cast v8, Lcom/adview/AdViewLayout;

    .line 30
    .local v8, adViewLayout:Lcom/adview/AdViewLayout;
    if-nez v8, :cond_1

    .line 47
    :goto_0
    return-void

    .line 34
    :cond_1
    iget-object v9, v8, Lcom/adview/AdViewLayout;->extra:Lcom/adview/obj/Extra;

    .line 35
    .local v9, extra:Lcom/adview/obj/Extra;
    iget v1, v9, Lcom/adview/obj/Extra;->bgRed:I

    iget v2, v9, Lcom/adview/obj/Extra;->bgGreen:I

    iget v3, v9, Lcom/adview/obj/Extra;->bgBlue:I

    invoke-static {v1, v2, v3}, Landroid/graphics/Color;->rgb(III)I

    move-result v5

    .line 36
    .local v5, bgColor:I
    iget v1, v9, Lcom/adview/obj/Extra;->fgRed:I

    iget v2, v9, Lcom/adview/obj/Extra;->fgGreen:I

    iget v3, v9, Lcom/adview/obj/Extra;->fgBlue:I

    invoke-static {v1, v2, v3}, Landroid/graphics/Color;->rgb(III)I

    move-result v6

    .line 37
    .local v6, fgColor:I
    const/4 v0, 0x0

    .line 38
    .local v0, adView:Lcn/casee/adsdk/CaseeAdView;
    invoke-static {}, Lcom/adview/AdViewTargeting;->getRunMode()Lcom/adview/AdViewTargeting$RunMode;

    move-result-object v1

    sget-object v2, Lcom/adview/AdViewTargeting$RunMode;->TEST:Lcom/adview/AdViewTargeting$RunMode;

    if-ne v1, v2, :cond_2

    .line 39
    new-instance v0, Lcn/casee/adsdk/CaseeAdView;

    .end local v0           #adView:Lcn/casee/adsdk/CaseeAdView;
    invoke-virtual {v8}, Lcom/adview/AdViewLayout;->getContext()Landroid/content/Context;

    move-result-object v1

    const-string v2, "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"

    const/4 v3, 0x1

    iget v4, v9, Lcom/adview/obj/Extra;->cycleTime:I

    mul-int/lit16 v4, v4, 0x3e8

    invoke-direct/range {v0 .. v7}, Lcn/casee/adsdk/CaseeAdView;-><init>(Landroid/content/Context;Ljava/lang/String;ZIIIZ)V

    .line 45
    .restart local v0       #adView:Lcn/casee/adsdk/CaseeAdView;
    :goto_1
    invoke-virtual {v0, p0}, Lcn/casee/adsdk/CaseeAdView;->setListener(Lcn/casee/adsdk/CaseeAdView$AdListener;)V

    goto :goto_0

    .line 40
    :cond_2
    invoke-static {}, Lcom/adview/AdViewTargeting;->getRunMode()Lcom/adview/AdViewTargeting$RunMode;

    move-result-object v1

    sget-object v2, Lcom/adview/AdViewTargeting$RunMode;->NORMAL:Lcom/adview/AdViewTargeting$RunMode;

    if-ne v1, v2, :cond_3

    .line 41
    new-instance v0, Lcn/casee/adsdk/CaseeAdView;

    .end local v0           #adView:Lcn/casee/adsdk/CaseeAdView;
    invoke-virtual {v8}, Lcom/adview/AdViewLayout;->getContext()Landroid/content/Context;

    move-result-object v1

    iget-object v2, p0, Lcom/adview/adapters/CaseeAdapter;->ration:Lcom/adview/obj/Ration;

    iget-object v2, v2, Lcom/adview/obj/Ration;->key:Ljava/lang/String;

    iget v3, v9, Lcom/adview/obj/Extra;->cycleTime:I

    mul-int/lit16 v4, v3, 0x3e8

    move v3, v7

    invoke-direct/range {v0 .. v7}, Lcn/casee/adsdk/CaseeAdView;-><init>(Landroid/content/Context;Ljava/lang/String;ZIIIZ)V

    .restart local v0       #adView:Lcn/casee/adsdk/CaseeAdView;
    goto :goto_1

    .line 43
    :cond_3
    new-instance v0, Lcn/casee/adsdk/CaseeAdView;

    .end local v0           #adView:Lcn/casee/adsdk/CaseeAdView;
    invoke-virtual {v8}, Lcom/adview/AdViewLayout;->getContext()Landroid/content/Context;

    move-result-object v1

    iget-object v2, p0, Lcom/adview/adapters/CaseeAdapter;->ration:Lcom/adview/obj/Ration;

    iget-object v2, v2, Lcom/adview/obj/Ration;->key:Ljava/lang/String;

    iget v3, v9, Lcom/adview/obj/Extra;->cycleTime:I

    mul-int/lit16 v4, v3, 0x3e8

    move v3, v7

    invoke-direct/range {v0 .. v7}, Lcn/casee/adsdk/CaseeAdView;-><init>(Landroid/content/Context;Ljava/lang/String;ZIIIZ)V

    .restart local v0       #adView:Lcn/casee/adsdk/CaseeAdView;
    goto :goto_1
.end method

.method public onFailedToReceiveAd(Lcn/casee/adsdk/CaseeAdView;)V
    .locals 3
    .parameter "arg0"

    .prologue
    .line 52
    invoke-static {}, Lcom/adview/AdViewTargeting;->getRunMode()Lcom/adview/AdViewTargeting$RunMode;

    move-result-object v1

    sget-object v2, Lcom/adview/AdViewTargeting$RunMode;->TEST:Lcom/adview/AdViewTargeting$RunMode;

    if-ne v1, v2, :cond_0

    .line 53
    const-string v1, "AdView SDK v1.7.0"

    const-string v2, "CASEE fail"

    invoke-static {v1, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 54
    :cond_0
    const/4 v1, 0x0

    invoke-virtual {p1, v1}, Lcn/casee/adsdk/CaseeAdView;->setListener(Lcn/casee/adsdk/CaseeAdView$AdListener;)V

    .line 56
    iget-object v1, p0, Lcom/adview/adapters/CaseeAdapter;->adViewLayoutReference:Ljava/lang/ref/WeakReference;

    invoke-virtual {v1}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/adview/AdViewLayout;

    .line 58
    .local v0, adViewLayout:Lcom/adview/AdViewLayout;
    if-nez v0, :cond_1

    .line 65
    :goto_0
    return-void

    .line 62
    :cond_1
    iget-object v1, v0, Lcom/adview/AdViewLayout;->adViewManager:Lcom/adview/AdViewManager;

    invoke-virtual {v1}, Lcom/adview/AdViewManager;->resetRollover_pri()V

    .line 63
    invoke-virtual {v0}, Lcom/adview/AdViewLayout;->rotateThreadedPri()V

    goto :goto_0
.end method

.method public onFailedToReceiveRefreshAd(Lcn/casee/adsdk/CaseeAdView;)V
    .locals 3
    .parameter "arg0"

    .prologue
    .line 69
    invoke-static {}, Lcom/adview/AdViewTargeting;->getRunMode()Lcom/adview/AdViewTargeting$RunMode;

    move-result-object v1

    sget-object v2, Lcom/adview/AdViewTargeting$RunMode;->TEST:Lcom/adview/AdViewTargeting$RunMode;

    if-ne v1, v2, :cond_0

    .line 70
    const-string v1, "AdView SDK v1.7.0"

    const-string v2, "success=>fail for fresh"

    invoke-static {v1, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 71
    :cond_0
    const/4 v1, 0x0

    invoke-virtual {p1, v1}, Lcn/casee/adsdk/CaseeAdView;->setListener(Lcn/casee/adsdk/CaseeAdView$AdListener;)V

    .line 73
    iget-object v1, p0, Lcom/adview/adapters/CaseeAdapter;->adViewLayoutReference:Ljava/lang/ref/WeakReference;

    invoke-virtual {v1}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/adview/AdViewLayout;

    .line 75
    .local v0, adViewLayout:Lcom/adview/AdViewLayout;
    if-nez v0, :cond_1

    .line 82
    :goto_0
    return-void

    .line 79
    :cond_1
    iget-object v1, v0, Lcom/adview/AdViewLayout;->adViewManager:Lcom/adview/AdViewManager;

    invoke-virtual {v1}, Lcom/adview/AdViewManager;->resetRollover_pri()V

    .line 80
    invoke-virtual {v0}, Lcom/adview/AdViewLayout;->rotateThreadedPri()V

    goto :goto_0
.end method

.method public onReceiveAd(Lcn/casee/adsdk/CaseeAdView;)V
    .locals 3
    .parameter "arg0"

    .prologue
    .line 87
    invoke-static {}, Lcom/adview/AdViewTargeting;->getRunMode()Lcom/adview/AdViewTargeting$RunMode;

    move-result-object v1

    sget-object v2, Lcom/adview/AdViewTargeting$RunMode;->TEST:Lcom/adview/AdViewTargeting$RunMode;

    if-ne v1, v2, :cond_0

    .line 88
    const-string v1, "AdView SDK v1.7.0"

    const-string v2, " CASEE success"

    invoke-static {v1, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 89
    :cond_0
    iget-object v1, p0, Lcom/adview/adapters/CaseeAdapter;->adViewLayoutReference:Ljava/lang/ref/WeakReference;

    invoke-virtual {v1}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/adview/AdViewLayout;

    .line 90
    .local v0, adViewLayout:Lcom/adview/AdViewLayout;
    const/4 v1, 0x0

    invoke-virtual {p1, v1}, Lcn/casee/adsdk/CaseeAdView;->setListener(Lcn/casee/adsdk/CaseeAdView$AdListener;)V

    .line 92
    if-nez v0, :cond_1

    .line 98
    :goto_0
    return-void

    .line 95
    :cond_1
    iget-object v1, v0, Lcom/adview/AdViewLayout;->adViewManager:Lcom/adview/AdViewManager;

    invoke-virtual {v1}, Lcom/adview/AdViewManager;->resetRollover()V

    .line 96
    iget-object v1, v0, Lcom/adview/AdViewLayout;->handler:Landroid/os/Handler;

    new-instance v2, Lcom/adview/AdViewLayout$ViewAdRunnable;

    invoke-direct {v2, v0, p1}, Lcom/adview/AdViewLayout$ViewAdRunnable;-><init>(Lcom/adview/AdViewLayout;Landroid/view/ViewGroup;)V

    invoke-virtual {v1, v2}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    .line 97
    invoke-virtual {v0}, Lcom/adview/AdViewLayout;->rotateThreadedDelayed()V

    goto :goto_0
.end method

.method public onReceiveRefreshAd(Lcn/casee/adsdk/CaseeAdView;)V
    .locals 3
    .parameter "arg0"

    .prologue
    .line 103
    invoke-static {}, Lcom/adview/AdViewTargeting;->getRunMode()Lcom/adview/AdViewTargeting$RunMode;

    move-result-object v1

    sget-object v2, Lcom/adview/AdViewTargeting$RunMode;->TEST:Lcom/adview/AdViewTargeting$RunMode;

    if-ne v1, v2, :cond_0

    .line 104
    const-string v1, "AdView SDK v1.7.0"

    const-string v2, " fail=>success for fresh"

    invoke-static {v1, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 105
    :cond_0
    iget-object v1, p0, Lcom/adview/adapters/CaseeAdapter;->adViewLayoutReference:Ljava/lang/ref/WeakReference;

    invoke-virtual {v1}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/adview/AdViewLayout;

    .line 106
    .local v0, adViewLayout:Lcom/adview/AdViewLayout;
    const/4 v1, 0x0

    invoke-virtual {p1, v1}, Lcn/casee/adsdk/CaseeAdView;->setListener(Lcn/casee/adsdk/CaseeAdView$AdListener;)V

    .line 108
    if-nez v0, :cond_1

    .line 115
    :goto_0
    return-void

    .line 111
    :cond_1
    iget-object v1, v0, Lcom/adview/AdViewLayout;->adViewManager:Lcom/adview/AdViewManager;

    invoke-virtual {v1}, Lcom/adview/AdViewManager;->resetRollover()V

    .line 112
    iget-object v1, v0, Lcom/adview/AdViewLayout;->handler:Landroid/os/Handler;

    new-instance v2, Lcom/adview/AdViewLayout$ViewAdRunnable;

    invoke-direct {v2, v0, p1}, Lcom/adview/AdViewLayout$ViewAdRunnable;-><init>(Lcom/adview/AdViewLayout;Landroid/view/ViewGroup;)V

    invoke-virtual {v1, v2}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    .line 113
    invoke-virtual {v0}, Lcom/adview/AdViewLayout;->rotateThreadedDelayed()V

    goto :goto_0
.end method
